package io.renren.modules.emp.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.emp.dao.EmpDao;
import io.renren.modules.emp.entity.EmpEntity;
import io.renren.modules.emp.service.EmpService;


@Service("empService")
public class EmpServiceImpl extends ServiceImpl<EmpDao, EmpEntity> implements EmpService {

    @Autowired
    private EmpDao empDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = (String) params.get("key");
        IPage<EmpEntity> page = this.page(
                new Query<EmpEntity>().getPage(params),
                new QueryWrapper<EmpEntity>().like("ename",key)
        );

        return new PageUtils(page);
    }

    @Override
    public void queryPageByConne(String ename, Page<EmpEntity> page) {
        empDao.queryPageByConne(ename,page);
    }

}